<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.9.1"/>
<title>OCILIB (C and C++ Driver for Oracle): Remote Instance startup/shutdown</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="navtreedata.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<script type="text/javascript">
  $(document).ready(initResizable);
  $(window).load(resizeHeight);
</script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td style="padding-left: 0.5em;">
   <div id="projectname">OCILIB (C and C++ Driver for Oracle)
   &#160;<span id="projectnumber">4.2.1</span>
   </div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.9.1 -->
  <div id="navrow1" class="tabs">
    <ul class="tablist">
      <li><a href="index.html"><span>About</span></a></li>
      <li><a href="modules.html"><span>Documentation</span></a></li>
      <li><a href="namespaces.html"><span>Namespaces</span></a></li>
      <li><a href="annotated.html"><span>Classes</span></a></li>
      <li><a href="files.html"><span>Files</span></a></li>
    </ul>
  </div>
</div><!-- top -->
<div id="side-nav" class="ui-resizable side-nav-resizable">
  <div id="nav-tree">
    <div id="nav-tree-contents">
      <div id="nav-sync" class="sync"></div>
    </div>
  </div>
  <div id="splitbar" style="-moz-user-select:none;" 
       class="ui-resizable-handle">
  </div>
</div>
<script type="text/javascript">
$(document).ready(function(){initNavTree('group___ocilib_c_api_instances_management.html','');});
</script>
<div id="doc-content">
<div class="header">
  <div class="summary">
<a href="#func-members">Functions</a>  </div>
  <div class="headertitle">
<div class="title">Remote Instance startup/shutdown<div class="ingroups"><a class="el" href="group___ocilib_c_api.html">C API</a></div></div>  </div>
</div><!--header-->
<div class="contents">
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
<p>OCILIB supports Oracle 11g client features for manipulating remote Oracle instances.</p>
<p>Oracle instances (on the same computer or on a remote server) can be :</p>
<ul>
<li>started with <a class="el" href="group___ocilib_c_api_instances_management.html#ga1f7f4e4a1f7f32d70296281546276ce5" title="Start a database instance. ">OCI_DatabaseStartup()</a></li>
<li>shutdown with <a class="el" href="group___ocilib_c_api_instances_management.html#ga6c4b72e7ad5c87691fdecca573dca41b" title="Shutdown a database instance. ">OCI_DatabaseShutdown()</a></li>
</ul>
<p>Several options are handled for this actions</p>
<dl class="section user"><dt>Example</dt><dd><div class="fragment"><div class="line"><span class="preprocessor">#include &quot;ocilib.h&quot;</span></div>
<div class="line"></div>
<div class="line"><span class="keywordtype">int</span> main(<span class="keywordtype">void</span>)</div>
<div class="line">{ </div>
<div class="line">    <a class="code" href="group___ocilib_c_api_initialization.html#ga01464863ddd68393106b63fb8cc1ead1">OCI_Initialize</a>(NULL, NULL, OCI_ENV_DEFAULT);</div>
<div class="line"></div>
<div class="line">    <span class="comment">/* start remote instance */</span></div>
<div class="line"></div>
<div class="line">    <a class="code" href="group___ocilib_c_api_instances_management.html#ga1f7f4e4a1f7f32d70296281546276ce5">OCI_DatabaseStartup</a>(<span class="stringliteral">&quot;db&quot;</span>, </div>
<div class="line">                        <span class="stringliteral">&quot;sys_usr&quot;</span>, </div>
<div class="line">                        <span class="stringliteral">&quot;sys_pwd&quot;</span>, </div>
<div class="line">                        OCI_SESSION_SYSDBA, </div>
<div class="line">                        OCI_DB_SPM_FULL,</div>
<div class="line">                        OCI_DB_SPF_FORCE,</div>
<div class="line">                        NULL);</div>
<div class="line"></div>
<div class="line"></div>
<div class="line">     <span class="comment">/* shutdown remote instance */</span></div>
<div class="line"></div>
<div class="line">    <a class="code" href="group___ocilib_c_api_instances_management.html#ga6c4b72e7ad5c87691fdecca573dca41b">OCI_DatabaseShutdown</a>(<span class="stringliteral">&quot;db&quot;</span>, </div>
<div class="line">                         <span class="stringliteral">&quot;sys_usr&quot;</span>, </div>
<div class="line">                         <span class="stringliteral">&quot;sys_pwd&quot;</span>,  </div>
<div class="line">                         OCI_SESSION_SYSDBA,</div>
<div class="line">                         OCI_DB_SDM_FULL,</div>
<div class="line">                         OCI_DB_SDF_ABORT);</div>
<div class="line">    <a class="code" href="group___ocilib_c_api_initialization.html#ga639706aa8e9689c7ebffc018fac6d3ae">OCI_Cleanup</a>();</div>
<div class="line">    </div>
<div class="line">    <span class="keywordflow">return</span> EXIT_SUCCESS;</div>
<div class="line">}   </div>
<div class="line"></div>
</div><!-- fragment --> </dd></dl>
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="func-members"></a>
Functions</h2></td></tr>
<tr class="memitem:ga1f7f4e4a1f7f32d70296281546276ce5"><td class="memItemLeft" align="right" valign="top">OCI_EXPORT boolean OCI_API&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___ocilib_c_api_instances_management.html#ga1f7f4e4a1f7f32d70296281546276ce5">OCI_DatabaseStartup</a> (const otext *db, const otext *user, const otext *pwd, unsigned int sess_mode, unsigned int start_mode, unsigned int start_flag, const otext *spfile)</td></tr>
<tr class="memdesc:ga1f7f4e4a1f7f32d70296281546276ce5"><td class="mdescLeft">&#160;</td><td class="mdescRight">Start a database instance.  <a href="#ga1f7f4e4a1f7f32d70296281546276ce5">More...</a><br /></td></tr>
<tr class="separator:ga1f7f4e4a1f7f32d70296281546276ce5"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga6c4b72e7ad5c87691fdecca573dca41b"><td class="memItemLeft" align="right" valign="top">OCI_EXPORT boolean OCI_API&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___ocilib_c_api_instances_management.html#ga6c4b72e7ad5c87691fdecca573dca41b">OCI_DatabaseShutdown</a> (const otext *db, const otext *user, const otext *pwd, unsigned int sess_mode, unsigned int shut_mode, unsigned int shut_flag)</td></tr>
<tr class="memdesc:ga6c4b72e7ad5c87691fdecca573dca41b"><td class="mdescLeft">&#160;</td><td class="mdescRight">Shutdown a database instance.  <a href="#ga6c4b72e7ad5c87691fdecca573dca41b">More...</a><br /></td></tr>
<tr class="separator:ga6c4b72e7ad5c87691fdecca573dca41b"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<h2 class="groupheader">Function Documentation</h2>
<a class="anchor" id="ga1f7f4e4a1f7f32d70296281546276ce5"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">OCI_EXPORT boolean OCI_API OCI_DatabaseStartup </td>
          <td>(</td>
          <td class="paramtype">const otext *&#160;</td>
          <td class="paramname"><em>db</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const otext *&#160;</td>
          <td class="paramname"><em>user</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const otext *&#160;</td>
          <td class="paramname"><em>pwd</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">unsigned int&#160;</td>
          <td class="paramname"><em>sess_mode</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">unsigned int&#160;</td>
          <td class="paramname"><em>start_mode</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">unsigned int&#160;</td>
          <td class="paramname"><em>start_flag</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const otext *&#160;</td>
          <td class="paramname"><em>spfile</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p><code>#include &lt;ocilib.h&gt;</code></p>

<p>Start a database instance. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">db</td><td>- Oracle Service Name </td></tr>
    <tr><td class="paramname">user</td><td>- Oracle User name </td></tr>
    <tr><td class="paramname">pwd</td><td>- Oracle User password </td></tr>
    <tr><td class="paramname">sess_mode</td><td>- Session mode </td></tr>
    <tr><td class="paramname">start_mode</td><td>- Start mode </td></tr>
    <tr><td class="paramname">start_flag</td><td>- Start flags </td></tr>
    <tr><td class="paramname">spfile</td><td>- Client-side spfile to start up the database (optional)</td></tr>
  </table>
  </dd>
</dl>
<p>Possible values for parameter sess_mode :</p><ul>
<li>OCI_SESSION_SYSDBA</li>
<li>OCI_SESSION_SYSOPER</li>
</ul>
<dl class="section note"><dt>Note</dt><dd>External credentials are supported by supplying a null value for the 'user' and 'pwd' parameters If the param 'db' is NULL then a connection to the default local DB is done</dd></dl>
<p>Possible (combined) values for parameter start_mode :</p><ul>
<li>OCI_DB_SPM_START : start the instance</li>
<li>OCI_DB_SPM_MOUNT : mount the instance</li>
<li>OCI_DB_SPM_OPEN : open the instance</li>
<li>OCI_DB_SPM_FULL : start, mount and open the instance</li>
</ul>
<p>Possible (combined) values for parameter start_flag :</p><ul>
<li>OCI_DB_SPF_DEFAULT : default startup</li>
<li>OCI_DB_SPF_FORCE : shuts down a running instance (if needed) using ABORT command and starts a new instance</li>
<li>OCI_DB_SPF_RESTRICT : allows database access only to users with both CREATE SESSION and RESTRICTED SESSION privileges</li>
</ul>
<dl class="section note"><dt>Note</dt><dd>If the client side spfile is not provided, the database is started with its server-side spfile</dd></dl>
<dl class="section return"><dt>Returns</dt><dd>TRUE on success otherwise FALSE </dd></dl>

<p>Referenced by <a class="el" href="classocilib_1_1_environment.html#a7165adb4dffe98f8ae5fcf5829f591b3">ocilib::Environment::StartDatabase()</a>.</p>

</div>
</div>
<a class="anchor" id="ga6c4b72e7ad5c87691fdecca573dca41b"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">OCI_EXPORT boolean OCI_API OCI_DatabaseShutdown </td>
          <td>(</td>
          <td class="paramtype">const otext *&#160;</td>
          <td class="paramname"><em>db</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const otext *&#160;</td>
          <td class="paramname"><em>user</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const otext *&#160;</td>
          <td class="paramname"><em>pwd</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">unsigned int&#160;</td>
          <td class="paramname"><em>sess_mode</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">unsigned int&#160;</td>
          <td class="paramname"><em>shut_mode</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">unsigned int&#160;</td>
          <td class="paramname"><em>shut_flag</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p><code>#include &lt;ocilib.h&gt;</code></p>

<p>Shutdown a database instance. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">db</td><td>- Oracle Service Name </td></tr>
    <tr><td class="paramname">user</td><td>- Oracle User name </td></tr>
    <tr><td class="paramname">pwd</td><td>- Oracle User password </td></tr>
    <tr><td class="paramname">sess_mode</td><td>- Session mode </td></tr>
    <tr><td class="paramname">shut_mode</td><td>- Shutdown mode </td></tr>
    <tr><td class="paramname">shut_flag</td><td>- Shutdown flag</td></tr>
  </table>
  </dd>
</dl>
<dl class="section warning"><dt>Warning</dt><dd>Possible values for parameter sess_mode :<ul>
<li>OCI_SESSION_SYSDBA</li>
<li>OCI_SESSION_SYSOPER</li>
</ul>
</dd></dl>
<dl class="section note"><dt>Note</dt><dd>External credentials are supported by supplying a null value for the 'user' and 'pwd' parameters If the param 'db' is NULL then a connection to the default local DB is done</dd></dl>
<p>Possible (combined) values for parameter shut_mode :</p><ul>
<li>OCI_DB_SDM_SHUTDOWN : shutdown the instance</li>
<li>OCI_DB_SDM_CLOSE : close the instance</li>
<li>OCI_DB_SDM_DISMOUNT : dismount the instance</li>
<li>OCI_DB_SDM_FULL : shutdown, close and dismount the instance</li>
</ul>
<p>Possible (exclusive) value for parameter shut_flag (from Oracle documentation) :</p><ul>
<li>OCI_DB_SDF_DEFAULT :<ul>
<li>Further connects are prohibited.</li>
<li>Waits for users to disconnect from the database</li>
</ul>
</li>
<li>OCI_DB_SDF_TRANS :<ul>
<li>Further connects are prohibited</li>
<li>No new transactions are allowed.</li>
<li>Waits for active transactions to complete</li>
</ul>
</li>
<li>OCI_DB_SDF_TRANS_LOCAL :<ul>
<li>Further connects are prohibited</li>
<li>No new transactions are allowed.</li>
<li>Waits only for local transactions to complete</li>
</ul>
</li>
<li>OCI_DB_SDF_IMMEDIATE :<ul>
<li>Does not wait for current calls to complete or users to disconnect from the database.</li>
<li>All uncommitted transactions are terminated and rolled back</li>
</ul>
</li>
<li>OCI_DB_SDF_ABORT :<ul>
<li>Does not wait for current calls to complete or users to disconnect from the database.</li>
<li>All uncommitted transactions are terminated and are not rolled back.</li>
<li>This is the fastest possible way to shut down the database, but the next database startup may require instance recovery.</li>
<li>Therefore, this option should be used only in unusual circumstances</li>
</ul>
</li>
</ul>
<dl class="section return"><dt>Returns</dt><dd>TRUE on success otherwise FALSE </dd></dl>

<p>Referenced by <a class="el" href="classocilib_1_1_environment.html#a13cfb9869267de416ecf18671c7002e3">ocilib::Environment::ShutdownDatabase()</a>.</p>

</div>
</div>
</div><!-- contents -->
</div><!-- doc-content -->
<!-- start footer part -->
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
  <ul>
    <li class="footer">Generated on Mon Mar 21 2016 22:26:37 for OCILIB (C and C++ Driver for Oracle) by
    <a href="http://www.doxygen.org/index.html">
    <img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.8.9.1 </li>
  </ul>
</div>
</body>
</html>
